import { request } from '@/api/api.js';

export function query(page, size, keyword) {
  return request({
    url: 'api/article/list?current=' + page + '&size=' + size + '&keyword=' + keyword,
    method: 'get'
  })
}

export function list() {
  return request({
    url: 'api/article/list',
    method: 'get'
  })
}

export function findById(id) {
  return request({
    url: 'api/article/detail/' + id,
    method: 'get'
  })
}

export function add(data) {
  return request({
    url: 'api/article',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/article/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/article',
    method: 'put',
    data
  })
}

export default {query, list, findById, add, edit, del }